package com.bjc.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @program: servlet
 * @description:
 * @author: bjc
 * @create: 2021-08-18 20:35
 */
public class OneServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        String result = "MY Hello World";
        //响应对象将结果写到响应体
        PrintWriter writer = resp.getWriter();
        writer.write(result);
    }
}
